package iit.projects.etaxi.model.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Reservation implements Serializable {
	
	private static final long serialVersionUID = 1561755643735927919L;
	
	/**
	 * <p>Primary Key</p>
	 */
	private Long id;
	
	/**
	 * <p>Reservation Code. Unique value</p>
	 */
	private String code;
	
	/**
	 * <p>Pick up Location Sub City</p>
	 */
	private SubCity fromSubCity;
	
	/**
	 * <p>Pick up Location</p>
	 */
	private String pickupAddress;
	
	/**
	 * <p>Pick Up Date and Time</p>
	 */
	private Date pickUpTime;
	
	/**
	 * <p>Destination Sub City</p>
	 */
	private SubCity toSubCity;
	
	/**
	 * <p>Type of Hire. Ex: Drop Hire, Waiting </p>
	 */
	private String hireType;
	
	/**
	 * <p>Status of the Hire. Ex: New, Processed, Assigned, Unassigned</p>
	 */
	private String status;
	
	/**
	 * <p>Seating Requirements</p>
	 */
	private Long seatingCapacity;
	
	/**
	 * <p>Luggage Requirements</p>
	 */
	private Long luggageCapacity;
	
	/**
	 * <p>Customer who makes the Reservation</p>
	 */
	private Customer customer;
	
	/**
	 * <p>Customer Name (If Operator makes the Reservation)</p>
	 */
	private String customerName;
	
	/**
	 * <p>Customer Contact Number (If Operator makes the Reservation)</p>
	 */
	private String customerContact;
	
	/**
	 * <p>Sms messages which are sent to drivers</p>
	 */
	private Set<SendingSms> sms = new HashSet<SendingSms>(0);
	
	/**
	 * <p>The time when this Reservation was last processed</p>
	 */
	private Date lastProcessedTime;
	
	/**
	 * <p>The Driver to whom the Reservation is assigned to</p>
	 */
	private Driver driver;
	
	/**
	 * <p>Amount charged for the Reservation</p>
	 */
	private Double charge;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public SubCity getFromSubCity() {
		return fromSubCity;
	}

	public void setFromSubCity(SubCity fromSubCity) {
		this.fromSubCity = fromSubCity;
	}

	public String getPickupAddress() {
		return pickupAddress;
	}

	public void setPickupAddress(String pickupAddress) {
		this.pickupAddress = pickupAddress;
	}

	public Date getPickUpTime() {
		return pickUpTime;
	}

	public void setPickUpTime(Date pickUpTime) {
		this.pickUpTime = pickUpTime;
	}

	public SubCity getToSubCity() {
		return toSubCity;
	}

	public void setToSubCity(SubCity toSubCity) {
		this.toSubCity = toSubCity;
	}

	public String getHireType() {
		return hireType;
	}

	public void setHireType(String hireType) {
		this.hireType = hireType;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Long getSeatingCapacity() {
		return seatingCapacity;
	}

	public void setSeatingCapacity(Long seatingCapacity) {
		this.seatingCapacity = seatingCapacity;
	}

	public Long getLuggageCapacity() {
		return luggageCapacity;
	}

	public void setLuggageCapacity(Long luggageCapacity) {
		this.luggageCapacity = luggageCapacity;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getCustomerContact() {
		return customerContact;
	}

	public void setCustomerContact(String customerContact) {
		this.customerContact = customerContact;
	}

	public Set<SendingSms> getSms() {
		return sms;
	}

	public void setSms(Set<SendingSms> sms) {
		this.sms = sms;
	}

	public Date getLastProcessedTime() {
		return lastProcessedTime;
	}

	public void setLastProcessedTime(Date lastProcessedTime) {
		this.lastProcessedTime = lastProcessedTime;
	}

	public Driver getDriver() {
		return driver;
	}

	public void setDriver(Driver driver) {
		this.driver = driver;
	}

	public Double getCharge() {
		return charge;
	}

	public void setCharge(Double charge) {
		this.charge = charge;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Reservation other = (Reservation) obj;
		if (getCode() == null) {
			if (other.getCode() != null)
				return false;
		} else if (!getCode().equals(other.getCode()))
			return false;
		return true;
	}

}
